home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Documentation / Engineering Notes / Miscellaneous / Part Info Resource < prev   
Encoding:
Text File  |  1996-08-16  |  2.3 KB  |  47 lines  |  [TEXT/ttxt]

  1. OpenDoc
  2. Development
  3. Framework
  4.                                                                                                                                                                                      
  5. Part Info Resource 
  6. ODF Release 1                                                                                                                                                             
  7.  
  8.  
  9. ODF Release 1 introduces a "Part Info" resource that must be defined by all ODF parts. This resource contains information that were, in previous releases, passed to the FW_CPart constructor.
  10.  
  11. The Part Info resource looks like this (taken from ODFTable, PartInfo.fr):
  12.  
  13. //--------------------------------------
  14. //    PartInfo Resource
  15. //--------------------------------------
  16.  
  17. resource FW_RPartInfo(kPartInfoID)
  18. {
  19.     // ----- Icon ID
  20.     kViewAsIconID,
  21.     
  22.     // ----- Part Name
  23.     kEditorUserString,
  24.     
  25.     // ----- PartKind
  26.     kKind
  27. };
  28.  
  29. The first field is the default icon ID used when a frame is viewed as an icon. You will usually reference the document icon defined in your BNDL resource. If you want to choose or create the icon dynamically, you can override FW_CFrame::GetIcon and provide a different icon.
  30.  
  31. The second field is the Editor User String. This is one of the strings, usually defined in your Binding.k file, used by your NMAP resources.
  32.  
  33. The last field is your part kind. This is also a string usually defined in your Binding.k file and used by your NMAP resources.
  34.  
  35. This resource MUST BE present. You will get an assertion if the resource is missing. 
  36.  
  37. The reasons for this resource are:
  38.  
  39.                 - OpenDoc for Windows doesn't have NMAPs resources. It is not possible to find the Editor User String and Part Kind by looking at the NMAP resources
  40.  
  41.                 - Passing the Editor User String to the FW_CPart constructor was making localization impossible 
  42.  
  43.                 - Future releases of ODF may add more fields to this resource so more default behaviors can be built into ODF. Good candidates are: the menu bar resource ID so ODF could automatically load your menu bar from resource, the About resource ID so you won't have to override your FW_CPart::DoMenu method just to present a standard About box.
  44.  
  45.  
  46. © 1993 - 1996 Apple Computer, Inc. All rights reserved.
  47. Apple, the Apple Logo, Macintosh, and OpenDoc are trademarks of Apple Computer, Inc., registered in the United States and other countries.